import * as vscode from 'vscode';
import { InlineDebugAdapterDescriptorFactory } from './debug-adapter';

/**
 * 激活 debug 程序
 *
 * @author chitanda
 * @date 2022-11-30 11:11:04
 * @export
 * @param {vscode.ExtensionContext} context
 */
export function activateDebug(context: vscode.ExtensionContext): void {
  const factory = new InlineDebugAdapterDescriptorFactory();
  context.subscriptions.push(
    vscode.debug.registerDebugAdapterDescriptorFactory('ibiz-cloud', factory),
  );
  if ('dispose' in factory) {
    context.subscriptions.push(factory);
  }
}
